import 'package:flutter/material.dart';
import 'package:testlzhu/utils/index.dart';

class CeilingHeaderDelegate2 extends SliverPersistentHeaderDelegate {


  final Widget child;

  CeilingHeaderDelegate2({required this.child});

  @override
  Widget build(BuildContext context, double shrinkOffset, bool overlapsContent) {
    return Container(
      height: 50,
      color: Colors.white,
      child: Padding(
        padding: const EdgeInsets.symmetric(horizontal: 34.0),
        child: child,
      ),
    );
  }

  @override
  double get maxExtent => 50;

  @override
  double get minExtent => 50;

  @override
  bool shouldRebuild(covariant SliverPersistentHeaderDelegate oldDelegate) {
    return true;
  }
}
